<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>产品信息表</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#value").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<form:form id="inputForm" modelAttribute="area" action="${ctx}/sys/area/save" method="post" class="form-horizontal btnbottom">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<div class="panel formbody">
			<div class="panel-body">
				<div class="line">
					<span>基本信息</span>
					<hr style="border: 1px dotted #ddd; width:100%;margin:0px;"/>
				</div>
				<ul class="form-box clearfix">
					<li>
						<p>上级区域：</p>
						<div class="form-right">
						    <sys:treeselect id="area" name="parent.id" value="${area.parent.id}" labelName="parent.name" labelValue="${area.parent.name}"
					        title="区域" url="/sys/area/treeData" extId="${area.id}" cssClass="width:170px" allowClear="true"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</li>
					<li>
						<p>区域名称：</p>
						<div class="form-right">
						    <form:input path="name" htmlEscape="false" maxlength="50" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</li>
					<li>
						<p>区域编码：</p>
						<div class="form-right">
							<form:input path="code" htmlEscape="false" maxlength="50" class="required"/>
						</div>
					</li>
					<li>
						<p>区域类型：</p>
						    <div class="form-right">
					           <form:select path="type" class="input-medium">
					           <form:options items="${fns:getDictList('sys_area_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				               </form:select>
				        </div>
					</li>
					<li>
						<p>备注信息：</p>
						<div class="form-right">
							<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="form-control"/>
						</div>
					</li>
				</ul>		
			</div>
		</div>
		<div class="panel panel-default bottom">
		<div class="panel-heading center">
			<button type="submit" class="btn-custom">保存</button>
			<button type="button" class="btn-custom" onclick="top.$.jBox.close(true);">关闭</button>
		</div>
	</div>
	</form:form>
</body>
</html>